package com.yixun.qfbao.hander;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yixun.qfbao.api.service.PremisesApiService;
import com.yixun.qfbao.apidto.GetPremisesListPageResDto;
import com.yixun.qfbao.constants.OpenApiConstant;
import com.yixun.qfbao.vo.GetPremisesListPageReqVo;
import com.yixun.qfbao.xf.model.enums.ResultEnum;
/**
 * 
 * 〈一句话功能简述〉<br> 
 * 〈功能详细描述〉
 *
 * @author liushihao
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@Service("getPremisesListPageHander")
public class GetPremisesListPageHander {
	private static final Logger logger = LoggerFactory.getLogger(GetPremisesListPageHander.class);

	@Autowired
	private PremisesApiService premisesApiService;

	public GetPremisesListPageResDto hander(GetPremisesListPageReqVo reqVo) {
		GetPremisesListPageResDto resDTO = new GetPremisesListPageResDto();
		try {
			resDTO = premisesApiService.getPremisesListPage(reqVo.getParams());
			resDTO.setResponseCode(ResultEnum.SUCCESS.getNo());
		} catch (Exception e) {
			resDTO.setResponseCode(OpenApiConstant.RC_EXCEPTION_ERROR.getResponseCode());
			resDTO.setResponseMessage(e.getMessage());
			logger.error("get premises list page hander error: ", e);
		}
		return resDTO;

	}

}
